\(\int (b \cos (c+d x))^m (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)) \, dx\) [35]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 33, antiderivative size = 31 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\frac {C (b \cos (c+d x))^{1+m} \sin (c+d x)}{b d (2+m)} \]

[Out]

C*(b*cos(d*x+c))^(1+m)*sin(d*x+c)/b/d/(2+m)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.030, Rules used = {3090} \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\frac {C \sin (c+d x) (b \cos (c+d x))^{m+1}}{b d (m+2)} \]

[In]

Int[(b*Cos[c + d*x])^m*(-((C*(1 + m))/(2 + m)) + C*Cos[c + d*x]^2),x]

[Out]

(C*(b*Cos[c + d*x])^(1 + m)*Sin[c + d*x])/(b*d*(2 + m))

Rule 3090

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A*Cos[e
+ f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] /; FreeQ[{b, e, f, A, C, m}, x] && EqQ[A*(m + 2) + C*(m +
1), 0]

Rubi steps \begin{align*} \text {integral}& = \frac {C (b \cos (c+d x))^{1+m} \sin (c+d x)}{b d (2+m)} \\ \end{align*}

Mathematica [C] (verified)

Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.

Time = 0.15 (sec) , antiderivative size = 113, normalized size of antiderivative = 3.65 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\frac {C (b \cos (c+d x))^m \cot (c+d x) \left ((3+m) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+m}{2},\frac {3+m}{2},\cos ^2(c+d x)\right )-(2+m) \cos ^2(c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3+m}{2},\frac {5+m}{2},\cos ^2(c+d x)\right )\right ) \sqrt {\sin ^2(c+d x)}}{d (2+m) (3+m)} \]

[In]

Integrate[(b*Cos[c + d*x])^m*(-((C*(1 + m))/(2 + m)) + C*Cos[c + d*x]^2),x]

[Out]

(C*(b*Cos[c + d*x])^m*Cot[c + d*x]*((3 + m)*Hypergeometric2F1[1/2, (1 + m)/2, (3 + m)/2, Cos[c + d*x]^2] - (2
+ m)*Cos[c + d*x]^2*Hypergeometric2F1[1/2, (3 + m)/2, (5 + m)/2, Cos[c + d*x]^2])*Sqrt[Sin[c + d*x]^2])/(d*(2
+ m)*(3 + m))

Maple [A] (verified)

Time = 11.00 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00

method result size
parallelrisch \(\frac {C \left (\cos \left (d x +c \right ) b \right )^{m} \sin \left (2 d x +2 c \right )}{2 \left (2+m \right ) d}\) \(31\)

[In]

int((cos(d*x+c)*b)^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/2*C/(2+m)/d*(cos(d*x+c)*b)^m*sin(2*d*x+2*c)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.06 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\frac {\left (b \cos \left (d x + c\right )\right )^{m} C \cos \left (d x + c\right ) \sin \left (d x + c\right )}{d m + 2 \, d} \]

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="fricas")

[Out]

(b*cos(d*x + c))^m*C*cos(d*x + c)*sin(d*x + c)/(d*m + 2*d)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 279 vs. \(2 (26) = 52\).

Time = 17.84 (sec) , antiderivative size = 279, normalized size of antiderivative = 9.00 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} - \frac {2 C \left (- \frac {b \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1} + \frac {b}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1}\right )^{m} \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d m \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d m \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d m + 2 d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d} + \frac {2 C \left (- \frac {b \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1} + \frac {b}{\tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 1}\right )^{m} \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{d m \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d m \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + d m + 2 d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 4 d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 d} & \text {for}\: d \neq 0 \\x \left (b \cos {\left (c \right )}\right )^{m} \left (- \frac {C \left (m + 1\right )}{m + 2} + C \cos ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \]

[In]

integrate((b*cos(d*x+c))**m*(-C*(1+m)/(2+m)+C*cos(d*x+c)**2),x)

[Out]

Piecewise((-2*C*(-b*tan(c/2 + d*x/2)**2/(tan(c/2 + d*x/2)**2 + 1) + b/(tan(c/2 + d*x/2)**2 + 1))**m*tan(c/2 +
d*x/2)**3/(d*m*tan(c/2 + d*x/2)**4 + 2*d*m*tan(c/2 + d*x/2)**2 + d*m + 2*d*tan(c/2 + d*x/2)**4 + 4*d*tan(c/2 +
 d*x/2)**2 + 2*d) + 2*C*(-b*tan(c/2 + d*x/2)**2/(tan(c/2 + d*x/2)**2 + 1) + b/(tan(c/2 + d*x/2)**2 + 1))**m*ta
n(c/2 + d*x/2)/(d*m*tan(c/2 + d*x/2)**4 + 2*d*m*tan(c/2 + d*x/2)**2 + d*m + 2*d*tan(c/2 + d*x/2)**4 + 4*d*tan(
c/2 + d*x/2)**2 + 2*d), Ne(d, 0)), (x*(b*cos(c))**m*(-C*(m + 1)/(m + 2) + C*cos(c)**2), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (31) = 62\).

Time = 0.48 (sec) , antiderivative size = 175, normalized size of antiderivative = 5.65 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=-\frac {{\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} C b^{m} \sin \left (-{\left (d x + c\right )} {\left (m + 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right ) - {\left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right )}^{\frac {1}{2} \, m} C b^{m} \sin \left (-{\left (d x + c\right )} {\left (m - 2\right )} + m \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right )\right )}{4 \cdot 2^{m} d {\left (m + 2\right )}} \]

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/4*((cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1)^(1/2*m)*C*b^m*sin(-(d*x + c)*(m + 2)
+ m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)) - (cos(2*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x
+ 2*c) + 1)^(1/2*m)*C*b^m*sin(-(d*x + c)*(m - 2) + m*arctan2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1)))/(2^m*d*
(m + 2))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2494 vs. \(2 (31) = 62\).

Time = 7.46 (sec) , antiderivative size = 2494, normalized size of antiderivative = 80.45 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\text {Too large to display} \]

[In]

integrate((b*cos(d*x+c))^m*(-C*(1+m)/(2+m)+C*cos(d*x+c)^2),x, algorithm="giac")

[Out]

2*(C*(abs(tan(1/2*d*x + 1/2*c)^2 - 1)*abs(b)/(tan(1/2*d*x + 1/2*c)^2 + 1))^m*tan(-1/4*pi*m*sgn(2*b*tan(1/2*d*x
 + 1/2*c)^4 - 4*b*tan(1/2*d*x + 1/2*c)^2 + 2*b)*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)*sgn(b)*sgn(tan(1/2*d*x + 1/2*c
)) + 1/4*pi*m*sgn(tan(1/2*d*x + 1/2*c)^2 - 1)*sgn(b)*sgn(t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an(1/2*d*x + 1/2*c)) + 1/2) + 1/4*pi*m*sgn(tan(1/2*d*x
 + 1/2*c)))^2 + 4*d*tan(1/2*d*x + 1/2*c)^2 + d*m + 2*d)

Mupad [B] (verification not implemented)

Time = 1.12 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.97 \[ \int (b \cos (c+d x))^m \left (-\frac {C (1+m)}{2+m}+C \cos ^2(c+d x)\right ) \, dx=\frac {C\,\sin \left (2\,c+2\,d\,x\right )\,{\left (b\,\cos \left (c+d\,x\right )\right )}^m}{2\,d\,\left (m+2\right )} \]

[In]

int((b*cos(c + d*x))^m*(C*cos(c + d*x)^2 - (C*(m + 1))/(m + 2)),x)

[Out]

(C*sin(2*c + 2*d*x)*(b*cos(c + d*x))^m)/(2*d*(m + 2))